import { http, URL } from '@/utils/http';
import { defineStore } from 'pinia';
import { getCookie } from '@/utils/util';
export const useUserStore = defineStore({
  id: 'userModule',
  state: () => ({
    accessToken: '',
    userLoginMsg: '',
    userInfo: <
      {
        tenantId: number;
        timestamp: string;
        userAccount: string;
        userName: string;
      }
    >{}
  }),
  actions: {
    setUserInfo(data: {
      tenantId: number;
      timestamp: string;
      userAccount: string;
      userName: string;
    }) {
      this.$state.userInfo = data;
    },
    setAccessToken(data: string) {
      this.$state.accessToken = data;
    },
    setMsg(data: string) {
      this.$state.userLoginMsg = data;
    }
  }
});
